home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / feynman / feynman.shar / FEYNMAN.1.0 / GLUONLINKS.tex < prev    next >
Text File  |  1992-05-13  |  7KB  |  145 lines

  1. %                       GLUONLINKS.TEX (FEB. 5, 1989)
  2. %  CALLED BY FEYNMAN(34).TEX.
  3. %
  4. %  Routines for drawing GLUON LINKS and GLUON CAPS used by FEYNMAN.TEX.
  5. %  Formerly in separate files (GLUONLINKS & GLUONCAPS).
  6. %  This file is read in when \gluonlink, \gluoncap, defined in GLUONSETUP(21+),
  7. %  and related commands (in \drawvetex) are used.
  8. %
  9. %  GLUON LINKS are used to link \CENTRAL-type gluon lines together 
  10. %  (eg: \REG & \FLIPPED gluons drawn diagonally).
  11. %  Syntax:   \drawline\gluon[\W\CENTRAL](x,y)[number of loops]\gluonlink
  12. %            \drawline\gluon[\W\CENTRAL](\pbackx,\pbacky)[number of loops]
  13. %
  14. %  GLUON CAPS are used on vertical and horizontal gluons to make the
  15. %  terminus of the gluon line end along the gluon axis.  It then draws
  16. %  a stem of length \stemlength (as though the command \BACKSTEMMED had
  17. %  been issued).  Principal use is when \drawvertex is used.
  18. %  Syntax:   \drawline\gluon[\W\FLAT](x,y)[number of loops]\gluoncap
  19. %
  20. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  21. %                                                                           %
  22. %                                                                           %
  23. %                                GLUON LINKS                                %
  24. %                                                                           %
  25. %                                                                           %
  26. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  27. %
  28. %        ROUTINE FOR LINKING \CENTRAL AND \FLIPPEDCENTRAL GLUONS
  29. %
  30. \gdef\gluonlink{
  31. \global\stemlengthx=401 \SETDIR \setadjxy \divide\adjx by -2 \divide\adjy by -2
  32. \ifcase\LDIR  
  33.      \linksetupB \ifodd\LCONFIG\LINKPUT[l]  \else\LINKPUT[r] \fi %\Ngluon
  34. \or  \ifodd\LCONFIG \linksetupBx \LINKPUT[tr]\LINKPUT[l]         %\NEgluon
  35.      \else          \linksetupBy \LINKPUT[tr]\LINKPUT[b]     \fi
  36. \or  \linksetupB \ifodd\LCONFIG\LINKPUT[t]  \else\LINKPUT[b] \fi %\Egluon
  37. \or  \ifodd\LCONFIG \linksetupBy \LINKPUT[br]\LINKPUT[t]         %\SEgluon
  38.      \else          \linksetupBx \LINKPUT[br]\LINKPUT[l]     \fi
  39. \or  \linksetupB \ifodd\LCONFIG\LINKPUT[r]  \else\LINKPUT[l] \fi %\Sgluon
  40. \or  \ifodd\LCONFIG \linksetupBx \LINKPUT[bl]\LINKPUT[r]         %\SWgluon
  41.      \else          \linksetupBy \LINKPUT[bl]\LINKPUT[t]     \fi
  42. \or  \linksetupB \ifodd\LCONFIG\LINKPUT[b]  \else\LINKPUT[t] \fi %\Wgluon
  43. \or  \ifodd\LCONFIG \linksetupBy \LINKPUT[tl]\LINKPUT[b]         %\NWgluon
  44.      \else          \linksetupBx \LINKPUT[tl]\LINKPUT[r]     \fi
  45. \else \UNIMPERROR 
  46. \fi
  47. \ifodd\LDIR\relax 
  48. \else \global\advance\pbackx by \adjx   \global\advance\pbacky by \adjy \fi
  49. \linksetupC
  50. }
  51. %
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. %                                                                           %
  54. %                                                                           %
  55. %                                GLUONCAPS                                  %
  56. %                                                                           %
  57. %                                                                           %
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %
  60. %            ROUTINE FOR CENTRALIZING/CAPPING GLUONS
  61. %
  62. \gdef\gluoncap{  % For centralizing gluons
  63. \global\stemlengthx=0  
  64. \ifodd\LDIR\message{NOTE:  Diagonal Gluons are not Capped}\relax
  65. \else
  66. \ifcase\LCONFIG \global\stemlengthx=1000  %\REG case for NSEW
  67. \or \global\stemlengthx=1000  %\FLIPPED case (NSEW)
  68. \or \global\stemlengthx=825   %\CURLY case (NSEW)
  69. \or \global\stemlengthx=825   %\FLIPPEDCURLY  case (NSEW)
  70. \or \global\stemlengthx=1030  %\FLAT case (NSEW)
  71. \or \global\stemlengthx=1030  %\FLIPPEDFLAT case (NSEW)
  72. \or \global\stemlengthx=0     %\CENTRAL case (NSEW)
  73. \or \global\stemlengthx=0     %\FLIPPEDCENTRAL case (NSEW)
  74. \or \global\stemlengthx=800   %\SQUASHED case (NSEW)
  75. \else\UNIMPERROR
  76. \fi % end \ifcase\LCONFIG
  77. \ifnum\stemlengthx>400
  78. \global\advance\LDIR by 2 \moduloeight\LDIR   \SETDIR 
  79. \global\advance\LDIR by 6 \moduloeight\LDIR   \setadjxy
  80. \ifodd\LCONFIG \multiply \adjx by -1   \multiply \adjy by -1 \fi
  81. \divide\adjx by 2  \divide\adjy by 2 \linksetupB
  82. \ifcase\LDIR 
  83.      \ifodd\LCONFIG\LINKPUT[tr]  \else\LINKPUT[tl]   \fi   %\NGLUON
  84. \or  \relax % \NEGLUON
  85. \or  \ifodd\LCONFIG\LINKPUT[br]  \else\LINKPUT[tr]   \fi   %\Egluon
  86. \or  \relax % \SEgluon
  87. \or  \ifodd\LCONFIG\LINKPUT[bl]  \else\LINKPUT[br]   \fi   %\Sgluon
  88. \or  \relax % \SWgluon
  89. \or  \ifodd\LCONFIG\LINKPUT[tl]  \else\LINKPUT[bl]   \fi   %\Wgluon
  90. \or  \relax % \NWgluon
  91. \else \UNIMPERROR 
  92. \fi
  93. \linksetupD
  94. \else\message{* NOTE:  Attempt to use gluoncap of less that 401 centipoints *}
  95. \fi % End of \ifnum\stemlengthx
  96. \fi % end \ifodd
  97. }
  98. %
  99. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  100. %                                                                           %
  101. %                                                                           %
  102. %       AUXILIARY ROUTINES USED BY BOTH \gluonlink and \gluoncap            %
  103. %                                                                           %
  104. %                                                                           %
  105. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  106. %
  107. \gdef\setadjxy{
  108. \adjx=\stemlengthx   \adjy=\stemlengthx % Yes, it's `x', not `y'.
  109. \multiply \adjx by \XDIR%  
  110. \multiply \adjy by \YDIR%  
  111. }
  112. \gdef\advancegluonlength{
  113. \global\advance\particlelengthx by \adjx \global\advance\particlelengthy by\adjy
  114. \global\advance\gluonlengthx by \adjx  \global\advance\gluonlengthy by \adjy
  115. % The new adjusted gluon lengths.
  116. }
  117. \gdef\LINKPUT[#1]{\ifnum\phantomswitch=0\put(\gluonbackx,\gluonbacky)
  118. {\oval(\stemlengthx,\stemlengthx)[#1]}\fi}  
  119. \gdef\linksetupBx{\global\advance\gluonbackx by \adjx}
  120. \gdef\linksetupBy{\global\advance\gluonbacky by \adjy}
  121. \gdef\linksetupB{\linksetupBx\linksetupBy}
  122. \gdef\linksetupC{
  123. \global\advance\pbackx by \adjx  \global\advance\pbacky by \adjy
  124. \global\gluonbackx=\pbackx   \global\gluonbacky=\pbacky
  125. % Take negative particle lengths into account.  \BOXLENGTHX,Y remain as before.
  126. \ifnum\plengthx<0 \multiply\adjx by -1 \fi
  127. \ifnum\plengthy<0 \multiply\adjy by -1 \fi
  128. \advancegluonlength
  129. }
  130. \gdef\linksetupD{
  131. \linksetupC
  132. \SETDIR 
  133. \setadjxy
  134. \divide\adjx by 2  \divide\adjy by 2 \linksetupB
  135. \global\pbackx=\gluonbackx   \global\pbacky=\gluonbacky
  136. \advancegluonlength
  137. \ifnum\phantomswitch=0\put(\pbackx,\pbacky){\line(\XDIR,\YDIR){\stemlength}}\fi
  138. \stemlengthx=\stemlength  %TESTING
  139. \setadjxy
  140. \global\advance\pbackx by \adjx  \global\advance\pbacky by \adjy
  141. \global\gluonbackx=\pbackx   \global\gluonbacky=\pbacky
  142. \advancegluonlength
  143. % The new adjusted gluon lengths and rear positions
  144. }
  145.